home *** CD-ROM | disk | FTP | other *** search
/ Amiga Plus Extra 1996 #3 / AmigaPlus_CD-ROM-EXTRA_Nr.3.bin / aminet-spiele / zwei spieler / lordofhosts / lohsrc.lzh / reqbase.h < prev    next >
C/C++ Source or Header  |  1991-05-10  |  13KB  |  354 lines

  1.  
  2. /* reqlibrary.h © 1988/1989 reserved by Colin Fox and Bruce Dawson */
  3.  
  4. #ifndef REQLIBRARY_H
  5. #define REQLIBRARY_H
  6.  
  7. #define    REQVERSION    1
  8.  
  9.  
  10. #define    NUMPAIRS    10
  11.  
  12. struct GadgetBlock
  13.     {
  14.     struct Gadget        Gadget;
  15.     struct Border        Border;
  16.     WORD                Pairs[NUMPAIRS];
  17.     struct IntuiText    Text;
  18.     };
  19.  
  20. struct StringBlock
  21.     {
  22.     struct Gadget        Gadget;
  23.     struct StringInfo    Info;
  24.     struct Border        Border;
  25.     WORD                Pairs[NUMPAIRS];
  26.     };
  27.  
  28. struct PropBlock
  29.     {
  30.     struct Gadget        Gadget;
  31.     struct PropInfo        Info;
  32.     struct Image        Image;
  33.     };
  34.  
  35. struct ScrollBlock
  36.     {
  37.     struct Gadget        ArrowUpLt;
  38.     struct Image        ImageUpLt;
  39.     struct Gadget        ArrowDnRt;
  40.     struct Image        ImageDnRt;
  41.     struct PropBlock    Prop;
  42.     };
  43.  
  44. struct TwoImageGadget
  45.     {
  46.     struct Gadget        Gadget;
  47.     struct Image        Image1;
  48.     struct Image        Image2;
  49.     };
  50.  
  51. #define    ATTITUDEB    16
  52.  
  53. #define    HORIZSLIDER        (0L<<ATTITUDEB)    /*;which way the slider stands*/
  54. #define    VERTSLIDER        (1L<<ATTITUDEB)    /*;This is so that it bypasses all gadget flags.*/
  55.  
  56.  
  57.  
  58. /*;         This structure is use with the TextRequester function.*/
  59.  
  60. struct TRStructure
  61.     {
  62.     char    *Text;            /* ;This is the message text, including printf() style formatting if desired.*/
  63.     char    *Controls;        /* ;This is the address of the parameter list, if printf() style formatting is used.*/
  64.     struct Window    *Window;/* ;This is an optional (zero if not used) pointer to a window on the screen you*/
  65.                             /* ;would like the requester to show up on.*/
  66.     char    *MiddleText;    /* ;If non-zero, this is the text for the gadget in the lower middle (returns 2).*/
  67.     char    *PositiveText;    /* ;If non-zero, this is the text for the gadget in the lower left hand corner (returns 1).*/
  68.     char    *NegativeText;    /* ;If non-zero, this is the text for the gadget in the lower right (returns 0).*/
  69.     char    *Title;            /* ;This is the title for the window.*/
  70.     WORD    KeyMask;        /* ;This is the qualifier mask for the keyboard shortcuts.*/
  71.                             /* ;Use $FFFF to allow any qualifiers (or none).*/
  72.                             /* ;Zero means that no keyboard shortcuts are allowed.*/
  73.     WORD    textcolor;        /* ;Color of the text.  Uses color 1 if no color specified. */
  74.     WORD    detailcolor;    /* ;Detail and block color, as in a NewWindow structure.  If */
  75.     WORD    blockcolor;        /* ;both are left zero, block pen will be set to 1. */
  76.     WORD    versionnumber;    /* ;Make SURE this is set to zero. */
  77.     LONG    rfu1;            /* ;Make SURE you leave these two zeroed also. */
  78.     LONG    rfu2;            /* ;Make SURE you leave these two zeroed also. */
  79.     };
  80.  
  81. /* NOTE:
  82.  
  83.     The  control  values  mentioned above are used if you choose to insert
  84. printf  style directives in your strings and should contain the address of
  85. a list of control parameters, usually on the stack.
  86.     */
  87.  
  88.  
  89.  
  90. /*;         Remember,   if  you  don't  want  to  go  through  the  hassle  of */
  91. /*; initializing a ExtendedColorRequester structure, you can always just call */
  92. /*; ColorRequester  (as opposed to ExtendedColorRequester).  ColorRequester */
  93. /*; just  takes  a  single  parameter, in D0, the color that should start out */
  94. /*; being highlit.  It returns a single value, the color that was selected at */
  95. /*; the end.
  96.  
  97. /*;         This structure is for use with the ExtendedColorRequester (_not_, */
  98. /*; the ColorRequester) function. */
  99.  
  100. struct ExtendedColorRequester
  101.     {
  102.     LONG    defcolor;        /*;The color that is initially highlit. */
  103.     APTR    window;            /*;The window the 'requester' opens up in. */
  104.     LONG    rfu1;            /*;Who knows what these will be used for, */
  105.     LONG    rfu2;            /*;but I'm sure we'll think of something. */
  106.     LONG    rfu3;            /*;Until then, just keep these zeroed. */
  107.     LONG    rfu4;            /*;Okay? */
  108.     LONG    rfu5;
  109.     };
  110.  
  111.  
  112.  
  113. /*;         This structure is for use with the GetLong function.*/
  114.  
  115. #define    GLNODEFAULTB    0    /*;Set this bit in the flags if you don't want a default*/
  116.                             /*;value to show up in the get long string gadget.  For*/
  117.                             /*;some things this is much better than having a zero*/
  118.                             /*;show up.*/
  119.  
  120. #define    GLNODEFAULTM    (1<<GLNODEFAULTB)
  121.  
  122. struct GetLongStruct
  123.     {
  124.     char    *titlebar;
  125.     LONG    defaultval;
  126.     LONG    minlimit;
  127.     LONG    maxlimit;
  128.     LONG    result;
  129.     struct Window    *window;
  130.     WORD    versionnumber;    /* ;Make SURE this is set to zero. */
  131.     LONG    flags;            /* Some, uh flags.  See above for bit definitions. */
  132.     LONG    rfu2;            /* ;Make SURE you leave these two zeroed also. */
  133.     };
  134.  
  135. struct GetStringStruct
  136.     {
  137.     char    *titlebar;
  138.     char    *stringbuffer;
  139.     struct    Window *window;
  140.     WORD    stringsize;        /* how many characters in the buffer */
  141.     WORD    visiblesize;        /* how many characters show on screen */
  142.     WORD    versionnumber;
  143.     LONG    flags;
  144.     LONG    rfu1;
  145.     LONG    rfu2;
  146.     LONG    rfu3;
  147.     };
  148.  
  149.  
  150.  
  151. #ifndef    DSIZE
  152. #define    DSIZE    130
  153. #define    FCHARS    30
  154. #endif
  155. #define    WILDLENGTH    30
  156.  
  157. #define    FRQSHOWINFOB    0    /*;Set this in Flags if you want .info files to show.  They default to hidden.*/
  158. #define    FRQEXTSELECTB    1    /*;Set this in Flags if you want extended select.  Default is not.*/
  159. #define    FRQCACHINGB        2    /*;Set this in Flags if you want directory caching.  Default is not.*/
  160. #define    FRQGETFONTSB    3    /*;Set this in Flags if you want a font requester rather than a file requester.*/
  161. #define    FRQINFOGADGETB    4    /*;Set this in Flags if you want a hide-info files gadget.*/
  162. #define    FRQHIDEWILDSB    5    /*;Set this in Flags if you DON'T want 'show' and 'hide' string gadgets.*/
  163. #define    FRQABSOLUTEXYB    6    /*;Use absolute x,y positions rather than centering on mouse.*/
  164. #define    FRQCACHEPURGEB    7    /*;Purge the cache whenever the directory date stamp changes if this is set.*/
  165. #define    FRQNOHALFCACHEB    8    /*;Don't cache a directory unless it is completely read in when this is set.*/
  166. #define    FRQNOSORTB        9    /*;Set this in Flags if you DON'T want sorted directories.*/
  167. #define    FRQNODRAGB        10    /*;Set this in Flags if you DON'T want a drag bar and depth gadgets.*/
  168. #define    FRQSAVINGB        11    /*;Set this bit if you are selecting a file to save to.*/
  169. #define    FRQLOADINGB        12    /*;Set this bit if you are selecting a file(s) to load from.*/
  170.                             /*;These two bits (save and load) aren't currently used for*/
  171.                             /*;anything, but they may be in the future, so you should*/
  172.                             /*;remember to set them.  Also, these bits make it easier if*/
  173.                             /*;somebody wants to customize the file requester for their*/
  174.                             /*;machine.  They can make it behave differently for loading*/
  175.                             /*;vs saving.*/
  176. #define    FRQDIRONLYB        13    /*;Allow the user to select a directory, rather than a file.*/
  177.  
  178. #define    FRQSHOWINFOM    (1<<FRQSHOWINFOB)
  179. #define    FRQEXTSELECTM    (1<<FRQEXTSELECTB)
  180. #define    FRQCACHINGM        (1<<FRQCACHINGB)
  181. #define    FRQGETFONTSM    (1<<FRQGETFONTSB)
  182. #define    FRQINFOGADGETM    (1<<FRQINFOGADGETB)
  183. #define    FRQHIDEWILDSM    (1<<FRQHIDEWILDSB)
  184. #define    FRQABSOLUTEXYM    (1<<FRQABSOLUTEXYB)
  185. #define    FRQCACHEPURGEM    (1<<FRQCACHEPURGEB)
  186. #define    FRQNOHALFCACHEM    (1<<FRQNOHALFCACHEB)
  187. #define    FRQNOSORTM        (1<<FRQNOSORTB)
  188. #define    FRQNODRAGM        (1<<FRQNODRAGB)
  189. #define    FRQSAVINGM        (1<<FRQSAVINGB)
  190. #define    FRQLOADINGM        (1<<FRQLOADINGB)
  191. #define    FRQDIRONLYM        (1<<FRQDIRONLYB)
  192.  
  193. struct ESStructure
  194.     {
  195.     struct ESStructure    *NextFile;
  196.     WORD    NameLength;            /* Length of thefilename field, not including the terminating zero. */
  197.     WORD    Pad;
  198.     APTR    Node;                /* For internal use only. */
  199.     char    thefilename[1];        /* This is a variable size field. */
  200.     };
  201.  
  202. struct FileRequester
  203.     {
  204.     UWORD    VersionNumber;                /* Make sure this is zeroed for now. */
  205.  
  206.     char    *Title;                        /* Hailing text */
  207.     char    *Dir;                        /* Directory array (DSIZE+1) */
  208.     char    *File;                        /* Filename array (FCHARS+1) */
  209.  
  210.     char    *PathName;                    /* Complete path name array (DSIZE+FCHARS+2) */
  211.  
  212.     struct Window    *Window;            /* Window requesting or NULL */
  213.  
  214.  
  215.     UWORD    MaxExtendedSelect;            /* Zero implies a maximum of 65535, as long as FRQEXTSELECT is set.*/
  216.     UWORD    numlines;                    /* Number of lines in file window. */
  217.     UWORD    numcolumns;                    /* Number of columns in file window. */
  218.     UWORD    devcolumns;
  219.     ULONG    Flags;                        /* Various - umm - flags.  See above for more info. */
  220.     UWORD    dirnamescolor;            /* These five colors will all default */
  221.     UWORD    filenamescolor;            /* to color one if you don't specify */
  222.     UWORD    devicenamescolor;        /* a color (ie; if you specify color zero). */
  223.     UWORD    fontnamescolor;            /* If you want color zero to be used, specify */
  224.     UWORD    fontsizescolor;            /* color 32, or some other too large number */
  225.                                     /* which mods down to zero. */
  226.  
  227.     UWORD    detailcolor;            /* If both of these colors are specified as */
  228.     UWORD    blockcolor;                /* zero then the block pen will be set to one. */
  229.  
  230.     UWORD    gadgettextcolor;        /* The color for the text of the five boolean gadgets.  Defaults to 1. */
  231.     UWORD    textmessagecolor;        /* The color for the message at the screen top.  Defaults to 1. */
  232.     UWORD    stringnamecolor;        /* The color for the words Drawer, File, Hide and Show.  Defaults to 3. */
  233.     UWORD    stringgadgetcolor;        /* The color for the borders of the string gadgets.  Defaults to 3. */
  234.                                     /* Unfortunately it is not possible to specify */
  235.                                     /* the color of the actual text in an Intuition */
  236.                                     /* string gadget. */
  237.     UWORD    boxbordercolor;            /* The color for the boxes around the file and directory areas.  Defaults to 3. */
  238.     UWORD    gadgetboxcolor;            /* The color for the boxes around the five boolean gadgets.  Defaults to 3. */
  239.  
  240.     UWORD    FRU_Stuff[18];                /* This area, which is reserved for */
  241.                                         /* future use, should all be zero. */
  242.  
  243.     struct DateStamp    DirDateStamp;    /* A copy of the cached directories date stamp. */
  244.                                         /* There should never be any need to change this. */
  245.  
  246.     UWORD    WindowLeftEdge;            /* These two fields are only used when the */
  247.     UWORD    WindowTopEdge;            /* FRQABSOLUTEXY flag is set.  They specify */
  248.                                     /* the location of the upper left hand */
  249.                                     /* corner of the window. */
  250.  
  251.     UWORD    FontYSize;                /* These fields are used to return the selected */
  252.     UWORD    FontStyle;                /* font size and style, only applicable when the */
  253.                                     /* font bit is set. */
  254.  
  255.     /*If you set the extended select bit and the user extended selects, the list of filenames will start from here.*/
  256.     struct ESStructure *ExtendedSelect;
  257.     char    Hide[WILDLENGTH+2];        /* The wildcards text. */
  258.     char    Show[WILDLENGTH+2];        /* More wildcards text. */
  259.     WORD    FileBufferPos;            /* Various fields taken from the various */
  260.     WORD    FileDispPos;            /* string gadgets so that the cursor */
  261.     WORD    DirBufferPos;            /* can be returned to the same position */
  262.     WORD    DirDispPos;                /* on subsequent calls. */
  263.     WORD    HideBufferPos;
  264.     WORD    HideDispPos;
  265.     WORD    ShowBufferPos;
  266.     WORD    ShowDispPos;
  267.  
  268. /**;      The  following  fields are PRIVATE!  Don't go messing with them or
  269. ; wierd  things may/will happen.  If this isn't enough of a warning, go read
  270. ; the one in intuition.h, that should scare you off.**/
  271.  
  272.     APTR    Memory;                        /* Memory allocate for dir entries. */
  273.     APTR    Memory2;                    /* More memory, used for hidden files. */
  274.     APTR    Lock;
  275.     char    PrivateDirBuffer[DSIZE+2];    /* Used for keeping a record of which */
  276.                                         /* directory we have file names for. */
  277.     struct FileInfoBlock    *FileInfoBlock;
  278.     WORD    NumEntries;
  279.     WORD    NumHiddenEntries;
  280.     WORD    filestartnumber;
  281.     WORD    devicestartnumber;
  282.     };
  283.  
  284.  
  285.  
  286. /*        This is used with the RealTimeScroll function. */
  287.  
  288. struct ScrollStruct
  289.      {
  290.     ULONG    TopEntryNumber;            /*;This is the ordinal number of the first*/
  291.                                     /*;displayed entry.*/
  292.     ULONG    NumEntries;                /*;This is the total number of entries in*/
  293.                                     /*;the list.*/
  294.     UWORD    LineSpacing;            /*;This is how many pixels high each entry is.*/
  295.     ULONG    NumLines;                /*;This is how many entries can be displayed simultaneously.*/
  296.     struct Gadget    *PropGadget;    /*;This is a pointer to the prop gadget being monitored.*/
  297.  
  298.     void    (*RedrawAll)();            /*;This routine is used to redraw all of the*/
  299.                                     /*;entries when the user moves far enough*/
  300.                                     /*;that scrolling will take too long.*/
  301.  
  302.     void    (*ReadMore)();            /*;An optional routine that is called when*/
  303.                                     /*;the scroll routine is waiting for movement.*/
  304.                                     /*;This allows reading of new data while real*/
  305.                                     /*;time scrolling.*/
  306.     void    (*ScrollAndDraw)();        /*;This routine is called when the data needs*/
  307.                                     /*;to be scrolled and updated.  This routine is*/
  308.                                     /*;passed four long parameters (on the stack and*/
  309.                                     /*;in D0-D3) which are, respectively:*/
  310.                                     /*;D0 - entry number of first line to be drawn.*/
  311.                                     /*;D1 - pixel offset to draw first line at.*/
  312.                                     /*;D2 - amount to scroll before doing any drawing.*/
  313.                                     /*;D3 - number of lines of data to draw.*/
  314.     WORD    versionnumber;            /*;Make SURE this is set to zero. */
  315.     LONG    rfu1;                    /*;Make SURE you leave these two zeroed also. */
  316.     LONG    rfu2;                    /*;Make SURE you leave these two zeroed also. */
  317.     };
  318.  
  319.  
  320.  
  321.  
  322.  
  323. struct chipstuff
  324.     {
  325.     char    ArrowUp[20];        /* 16 pixels wide, 10 pixels high. */
  326.     char    ArrowDown[20];        /* 16 pixels wide, 10 pixels high. */
  327.     char    ArrowLeft[18];        /* 16 pixels wide, 9 pixels high. */
  328.     char    ArrowRight[18];        /* 16 pixels wide, 9 pixels high. */
  329.     char    Letter_R[20];        /* 16 pixels wide, 10 pixels high. */
  330.     char    Letter_G[20];        /* 16 pixels wide, 10 pixels high. */
  331.     char    Letter_B[20];        /* 16 pixels wide, 10 pixels high. */
  332.     char    Letter_H[20];        /* 16 pixels wide, 10 pixels high. */
  333.     char    Letter_S[20];        /* 16 pixels wide, 10 pixels high. */
  334.     char    Letter_V[20];        /* 16 pixels wide, 10 pixels high. */
  335.     };
  336.  
  337. struct ReqLib
  338.     {
  339.     struct Library RLib;
  340.     struct AbsExecBase        *SysLib;
  341.     struct DosBase            *DosLib;
  342.     struct IntuitionBase    *IntuiLib;
  343.     struct GfxBase            *GfxLib;
  344.     APTR                    SegList;
  345.     struct chipstuff        *Images;
  346.     BYTE                    Flags;
  347.     BYTE                    Pad;
  348.     char                    *ConsoleDev;    /* Not really a char*, but it should work */
  349.     struct    IOStdReq        *ConsoleHandle;
  350.     };
  351.  
  352.  
  353. #endif
  354.